# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=gibberish-detector
pkgver=v0.1.1.r2.gecac969
pkgrel=5
pkgdesc='Train a model and detect gibberish strings with it.'
arch=('any')
groups=('blackarch' 'blackarch-misc')
url='https://github.com/domanchi/gibberish-detector'
license=('MIT')
depends=('python')
makedepends=('git' 'python-setuptools')
source=("git+https://github.com/domanchi/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -D examples/* -t "$pkgdir/usr/share/$pkgname/examples"
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

